package com.tac.pojo.vo;

import io.swagger.annotations.ApiModel;
import lombok.Data;

@Data
@ApiModel
public class Page<T> {
    private T data;
    private Integer TotalLimit;//总条数
    private Integer TotalPage;//总页数

    public static <T> Page<T> get(T date,Integer TotalLimit,int limit){
        Integer TotalPage;
        if(TotalLimit%limit==0){
            TotalPage=TotalLimit/limit;
        }else {
            TotalPage=TotalLimit/limit+1;//总条数
        }

        Page<T> page = new Page<>();
        page.data=date;
        page.TotalLimit=TotalLimit;
        page.TotalPage=TotalPage;
        return page;
    }
}
